<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>数据对象模板管理</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/dtree.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/font/dtreefont.css"/>
    <link rel="stylesheet" href="../../assets/module/admin.css?v=313"/>
    <link rel="stylesheet" href="../../assets/css/publicStyle.css"/>
    <link rel="stylesheet" href="../../assets/css/micro/template.css"/>
    <!--[if lt IE 9]>
    <script src="../../assets/libs/html5shiv.min.js"></script>
    <script src="../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <script src="../../assets/libs/template-web.js"></script>
</head>
<body>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <!-- 左列表 -->
        <div class=" layui-col-sm12 layui-col-md3 layui-col-lg3">
            <div class="layui-card">
                <div class="layui-card-header">指标模板</div>
                <div class="layui-card-body" >
                    <div id="template-iden-tmpl-box"></div>
                    <div id="microTemplateListBox">

                    </div>
                    <div id="templatePageBox"></div>

                </div>
            </div>
        </div>
        <!-- 右表 -->
        <div class="layui-col-sm12 layui-col-md9 layui-col-lg9">
            <div class="layui-card">
                <div class="layui-card-header">指标管理</div>
                <div class="layui-card-body mini-bar" >
                    <div id="template-idenManage-tmpl-box"></div>
                    <div id="page-box"></div>
                    <table class="layui-table" id="identGroupTable" lay-filter="identGroupTable" lay-skin="nob"></table>
                    <!-- 更多筛选条件弹窗 -->
                    <div class="" id="idenMoreFilterModel">
                        <fieldset class="layui-elem-field layui-field-title" >
                            <legend>指标管理更多筛选</legend>
                        </fieldset>
                        <form id="idenMoreFilterForm" lay-filter="idenMoreFilterForm" class="layui-form model-form ">
                            <input name="userId" type="hidden"/>
                            <div class="layui-form-item">
                                <label class="layui-form-label">指标名称</label>
                                <div class="layui-input-block">
                                    <input name="idenName" placeholder="请输入指标名称" type="text" class="layui-input" maxlength="20"
                                           lay-verType="tips" lay-verify="" />
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">指标数据类型</label>
                                <div class="layui-input-block">
                                    <select name="iden_type" placeholder="请选择指标数据类型" id="searchIdenType">

                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item text-left">
                                <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" id="closeIdenMoreFilterModel">取消</button>
                                <button class="layui-btn layui-btn-sm" lay-filter="idenMoreFilterModelSubmit" lay-submit >搜索</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 指标模板列表 -->
<script type="text/tmpl" id="microTemplateListTmpl">
<ul>
{{ target}}
  {{each records}}
    <li >{{$index+1}}&nbsp;&nbsp;{{$value.name}}</li>
{{/each}}
</ul>

</script>

<!-- 新增指标模板弹窗 -->
<script type="text/html" id="AddTemplateIdenModel">
    <form id="AddTemplateIdenForm" lay-filter="AddTemplateIdenForm" class="layui-form model-form ">
        <input name="userId" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">模板名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入模板名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="AddTemplateSubmit" lay-submit >确定</button>
        </div>
    </form>
</script>

<!-- 新增指标弹窗 -->
<script type="text/html" id="model-add-idenManage">
    <form id="addIdenManageForm" lay-filter="addGroupForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">指标名称</label>
            <div class="layui-input-block">
                <input name="iden_name" placeholder="请输入指标名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标代码别名</label>
            <div class="layui-input-block">
                <input name="iden_alias_code" placeholder="请输入指标代码别名" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标数据类型</label>
            <div class="layui-input-block" id="addIdenTypeBox">

            </div>
        </div>
        <div class="layui-form-item iden_length">
            <label class="layui-form-label">指标长度</label>
            <div class="layui-input-block" id="iden_length">
                <input name="iden_length" placeholder="请输入指标长度" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item iden_precision">
            <label class="layui-form-label">指标精度</label>
            <div class="layui-input-block">
                <input name="iden_precision" placeholder="请输入指标精度" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标简称</label>
            <div class="layui-input-block">
                <input name="iden_simple_name" placeholder="请输入指标简称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">获取渠道</label>
            <div class="layui-input-block" id="procurementTypeBox">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">使用方式</label>
            <div class="layui-input-block" id="useTypeBox">
            </div>
        </div>
        <div class="layui-form-item identGroup">
            <label class="layui-form-label">枚举分组</label>
            <div class="layui-input-block" >
                <select name="identid" placeholder="请选择枚举分组" id="identGroupBOX" lay-filter="identGroup">

                </select>
            </div>
        </div>
        <div class="layui-form-item ident_version">
            <label class="layui-form-label">枚举分组版本</label>
            <div class="layui-input-block">
                <select name="ident_version" placeholder="请选择枚举分组版本" id="ident_version_box" >

                </select>
            </div>
        </div>
        <div class="layui-form-item idenUnitsGroup">
            <label class="layui-form-label ">指标单位分组</label>
            <div class="layui-input-block" >
                <select name="iden_unit_name" placeholder="请选择指标单位分组" id="idenUnitsGroupBOX" lay-filter="idenUnitsGroupBOX">

                </select>
            </div>
        </div>
        <div class="layui-form-item idenUnitsValue">
            <label class="layui-form-label ">指标单位名称</label>
            <div class="layui-input-block" >
                <select name="iden_unitvl_id" id="idenUnitsValueBOX" placeholder="请选择指标单位名称">

                </select>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">指标描述</label>
            <div class="layui-input-block">
                        <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea"
                                  lay-verType="tips" lay-verify="" ></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否展示</label>
            <div class="layui-input-block">
                <input type="checkbox" checked name="is_displayed" lay-skin="switch" lay-text="是|否" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否业务主键</label>
            <div class="layui-input-block">
                <input type="checkbox" checked name="is_pk" lay-skin="switch" lay-text="是|否" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否可用</label>
            <div class="layui-input-block">
                <input type="checkbox" checked name="status" lay-skin="switch" lay-text="是|否" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否设为搜索列</label>
            <div class="layui-input-block">
                <input type="checkbox" checked name="is_search" lay-skin="switch" lay-text="是|否" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="addIdenSubmit" lay-submit >确定</button>
        </div>
    </form>
</script>

<!-- 编辑指标弹窗 -->
<script type="text/html" id="model-edit-idenManage">
    <form id="editIdenManageForm" lay-filter="editIdenManageForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">指标名称</label>
            <div class="layui-input-block">
                <input name="iden_name" placeholder="请输入指标名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标代码别名</label>
            <div class="layui-input-block">
                <input name="iden_alias_code" placeholder="请输入指标代码别名" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标数据类型</label>
            <div class="layui-input-block" id="editIdenTypeBox">

            </div>
        </div>
        <div class="layui-form-item iden_length">
            <label class="layui-form-label">指标长度</label>
            <div class="layui-input-block" id="edit_iden_length">
                <input name="iden_length" placeholder="请输入指标长度" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item iden_precision">
            <label class="layui-form-label">指标精度</label>
            <div class="layui-input-block">
                <input name="iden_precision" placeholder="请输入指标精度" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标简称</label>
            <div class="layui-input-block">
                <input name="iden_simple_name" placeholder="请输入指标简称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">获取渠道</label>
            <div class="layui-input-block" id="editProcurementTypeBox">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">使用方式</label>
            <div class="layui-input-block" id="editUseTypeBox">
            </div>
        </div>
        <div class="layui-form-item identGroup">
            <label class="layui-form-label">枚举分组</label>
            <div class="layui-input-block" >
                <select name="identid" placeholder="请选择枚举分组" id="editIdentGroupBox" lay-filter="editIdentGroupBox">

                </select>
            </div>
        </div>
        <div class="layui-form-item ident_version">
            <label class="layui-form-label">枚举分组版本</label>
            <div class="layui-input-block">
                <select name="ident_version" placeholder="请选择枚举分组版本" id="edit_ident_version_box">

                </select>
            </div>
        </div>
        <div class="layui-form-item idenUnitsGroup">
            <label class="layui-form-label ">指标单位分组</label>
            <div class="layui-input-block" id="">
                <select name="iden_unit_name" placeholder="请选择指标单位分组" id="editIdenUnitsGroupBOX" lay-filter="editIdenUnitsGroupBOX">

                </select>
            </div>
        </div>
        <div class="layui-form-item idenUnitsValue">
            <label class="layui-form-label ">指标单位名称</label>
            <div class="layui-input-block" >
                <select name="iden_unitvl_id" id="editIdenUnitsValueBOX" placeholder="请选择指标单位名称">

                </select>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">指标描述</label>
            <div class="layui-input-block">
                        <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea"
                                  lay-verType="tips" lay-verify="" ></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否展示</label>
            <div class="layui-input-block">
                <input type="checkbox" name="is_displayed" lay-skin="switch" lay-text="是|否" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否业务主键</label>
            <div class="layui-input-block">
                <input type="checkbox" name="is_pk" lay-skin="switch" lay-text="是|否" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否可用</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" lay-skin="switch" lay-text="是|否" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否设为搜索列</label>
            <div class="layui-input-block">
                <input type="checkbox" name="is_search" lay-skin="switch" lay-text="是|否" lay-verify="required">
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="editIdenSubmit" lay-submit >确定</button>
        </div>
    </form>
</script>

<!-- 分组版本管理弹窗 -->
<script type="text/html" id="mode-version-Group">
    <form id="versionGroupForm" lay-filter="versionGroupForm" class="layui-form model-form">
        <div class="layui-form-item layui-row">
            <div class="layui-inline layui-col-md12">
                <label class="layui-form-label">版本值</label>
                <div class="layui-input-block">
                    <input name="ckName" type="text" placeholder="请输入版本值" class="layui-input"
                           lay-verType="tips" lay-verify="required" required/>
                </div>
                <label class="layui-form-label">版本备注</label>
                <div class="layui-input-block">
                    <input name="ckYm" type="text" placeholder="请输入版本备注" class="layui-input"
                           lay-verType="tips" lay-verify="required" required/>
                </div>
                <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="addVersion">添加版本</button>
            </div>
        </div>
    </form>
    <div class="layui-form-item layui-row mode-version-table" >
        <table class="layui-table" id="identGroupVersionTable" lay-filter="identGroupVersionTable" lay-skin="nob"></table>
    </div>
</script>

<!--渲染指标管理权限-->
<script type="text/tmpl" id="template-idenManage-tmpl">
    <div class="layui-form toolbar">
        <div class="layui-form-item">
            <div class="layui-inline">
                {{ if hasPower("/micro/template-idenManage:queryList")}}
                <div class="layui-input-inline mr0">
                    <input name="iden_name" class="layui-input layui-input-sm" type="text" placeholder="输入关键字"/>
                </div>
                {{/if}}
            </div>
            <div class="layui-inline">
                {{ if hasPower("/micro/template-idenManage:queryList")}}
                <button class="layui-btn icon-btn layui-btn-sm" lay-filter="filterIden" lay-submit>
                    <i class="layui-icon">&#xe615;</i>搜索
                </button>
                {{/if}}
                {{ if hasPower("/micro/ident-group:queryList")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="morefilter-btn-idenManage" >
                    …   更多筛选
                </button>
                {{/if}}
                {{ if hasPower("/micro/template-idenManage:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="add-btn-template-idenManage" >
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                {{/if}}
                {{ if hasPower("/micro/template-idenManage:import")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="import-btn-template-idenManage">
                    <i class="layui-icon">&#xe62f;</i>导入
                </button>
                {{/if}}
            </div>
        </div>
    </div>
  </script>

<!-- 分组表格操作列DOM -->
<script id="ident-template-idenManage-box">
</script>

<!-- 指标管理表格操作列 -->
<script type="text/tmpl" id="ident-template-idenManage-tmp">
    {{ if hasPower("/micro/template-idenManage:edit")}}
    <a class="layui-btn layui-btn-xs layui-btn-warning" lay-event="edit">编辑</a>
    {{/if}}
    {{ if hasPower("/micro/template-idenManage:delete")}}
    <a class="layui-btn layui-btn-danger layui-btn-xs micro-ident-group-delete" lay-event="delete">删除</a>
    {{/if}}
</script>

<!--渲染指标模板权限-->
<script type="text/tmpl" id="template-iden-tmpl">
     <div class="layui-form toolbar">
        <div class="layui-form-item">
            <div class="layui-inline">
                {{if hasPower("/micro/template-iden:query")}}
                 <div class="layui-inline">
                     <div class="layui-input-inline mr0">
                        <input name="name" class="layui-input layui-input-sm" type="text" placeholder="输入模板名称"/>
                    </div>
                 </div>
                 <div class="layui-inline">
                    <button class="layui-btn icon-btn layui-btn-sm" lay-filter="searchTemplate" id="searchTemplate" lay-submit >
                        <i class="layui-icon">&#xe615;</i>搜索
                    </button>
                 </div>
                {{/if}}
                 <div class="layui-inline">
                {{if hasPower("/micro/template-iden:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="addTemplateIdenBtn">
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                {{/if}}
                {{if hasPower("/micro/template-iden:edit")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="editTemplateIdenBtn">
                    <i class="layui-icon">&#xe642;</i>编辑
                </button>
                {{/if}}
                {{if hasPower("/micro/template-iden:delete")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="deleteTemplateIdenBtn">
                    <i class="layui-icon">&#xe640;</i>删除
                </button>
                {{/if}}
                </div>
            </div>
        </div>
     </div>
</script>

<!--渲染指标类型-->
<script type="text/tmpl" id="template-idenType-tmpl">
    <select name="iden_type" placeholder="请选择"  lay-filter="idenType">
         {{each data}}
            <option value="{{$value.value}}">{{$value.iden_type}}</option>
        {{/each}}
    </select>
</script>
<!--渲染指标获取渠道-->
<script type="text/tmpl" id="template-procurementType-tmpl">
    <select name="data_procurement" placeholder="请选择">
         {{each data}}
            <option value="{{$value.value}}">{{$value.procurement_type}}</option>
        {{/each}}
    </select>
</script>
<!--渲染指标使用方式-->
<script type="text/tmpl" id="template-userType-tmpl">
    <select name="data_use" placeholder="请选择">
         {{each data}}
            <option value="{{$value.value}}">{{$value.use_type}}</option>
        {{/each}}
    </select>
</script>
<!--渲染指标单位分组-->
<script type="text/tmpl" id="template-idenUnitsGroup-tmpl">

         {{each records}}
            <option value="{{$value.id}}">{{$value.cnname}}</option>
        {{/each}}

</script>
<!--渲染指标单位值-->
<script type="text/tmpl" id="template-idenUnitsValue-tmpl">
     {{each records}}
        <option value="{{$value.id}}">{{$value.cnname}}</option>
    {{/each}}
</script>
<!--渲染枚举分组-->
<script type="text/tmpl" id="template-microGroup-tmpl">
    <option value="">请选择</option>
     {{each records}}
        <option value="{{$value.id}}">{{$value.name}}</option>
    {{/each}}

</script>
<!--渲染枚举分组版本-->
<script type="text/tmpl" id="template-microValue-tmpl">
    <option value="">请选择</option>
     {{each data}}
        <option value="{{$value.id}}">{{$value.value}}</option>
    {{/each}}
</script>
<!-- js部分 -->
<script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="../../assets/js/common.js?v=313"></script>
<script src="../../assets/libs/jquery/jquery-3.2.1.min.js"></script>

<script src="../../assets/libs/template-web.js"></script>
<script src="../../assets/libs/axios.min.js"></script>
<script src="../../assets/js/config.js"></script>
<script src="../../assets/js/authority.js"></script>

<script type="text/javascript" src="../../assets/js/micro/template.js"></script>

</body>

</html>